<?php
/**
 * @ClassName: Uplevel
 * @Description: TODO
 * @author: gydtrade
 * @Date: 2025-10-20 23:49
 * @Version: V1.0.0
 */

namespace app\api\controller\agent;

use app\api\controller\Api;
use app\common\model;

class Uplevel extends Api
{
    public function upConfig()
    {
        $data['config'] = model\AgentUpgradeConfig::where(['id' => 1])->find();
        $data['levelList'] = model\AgentLevel::field('level as value,name as label')->order('level')->select();
        $data['opreateList'] = AgentOperationAwardModel::field('level as value,name as label')->order('level')->select();
        $data['member'] = $this->member;
        $data['member']['agent_level_text'] = model\AgentLevel::where(['level' => $this->member['agent_level']])->value('name');
        return json(['code' => 1, 'msg' => 'ok', 'data' => $data]);
    }

}